<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JDK 17 神仙语法特性指南</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .feature-card {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            border: 1px solid rgba(255, 255, 255, 0.18);
        }
        
        .feature-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
        }
        
        .code-block {
            background: #1e1e1e;
            color: #d4d4d4;
            border-radius: 8px;
            padding: 1.5rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .section-title {
            position: relative;
            display: inline-block;
            font-weight: 700;
            color: #1a202c;
            margin-bottom: 2rem;
        }
        
        .section-title::after {
            content: '';
            position: absolute;
            bottom: -10px;
            left: 0;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .timeline-item {
            position: relative;
            padding-left: 40px;
            margin-bottom: 2rem;
        }
        
        .timeline-item::before {
            content: '';
            position: absolute;
            left: 10px;
            top: 8px;
            width: 12px;
            height: 12px;
            background: #667eea;
            border-radius: 50%;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
        }
        
        .timeline-item::after {
            content: '';
            position: absolute;
            left: 15px;
            top: 20px;
            width: 2px;
            height: calc(100% + 10px);
            background: #e2e8f0;
        }
        
        .timeline-item:last-child::after {
            display: none;
        }
        
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .floating-icon {
            animation: float 3s ease-in-out infinite;
        }
        
        @keyframes float {
            0%, 100% { transform: translateY(0px); }
            50% { transform: translateY(-10px); }
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto">
            <div class="text-center">
                <div class="floating-icon inline-block mb-6">
                    <i class="fas fa-code text-6xl opacity-90"></i>
                </div>
                <h1 class="text-5xl md:text-6xl font-bold mb-6">
                    JDK 17 <span class="text-yellow-300">神仙语法</span>特性指南
                </h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90 max-w-3xl mx-auto">
                    告别 Java 8 的冗长代码，拥抱现代 Java 编程的优雅与高效
                </p>
                <div class="flex flex-wrap justify-center gap-4 text-lg">
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full">
                        <i class="fas fa-clock mr-2"></i>代码量减少 30%
                    </span>
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full">
                        <i class="fas fa-rocket mr-2"></i>开发效率翻倍
                    </span>
                    <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full">
                        <i class="fas fa-shield-alt mr-2"></i>LTS 长期支持
                    </span>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto">
            <div class="bg-white rounded-2xl shadow-xl p-8 md:p-12">
                <p class="text-lg leading-relaxed text-gray-700 mb-6">
                    <span class="text-4xl float-left mr-3 mt-1 gradient-text font-serif">还</span>
                    在用 Java 8 写代码？是时候升级你的技能库了！JDK 17 作为一个长期支持版本，带来了一系列令人惊艳的语法特性，让 Java 编程变得更加简洁高效。
                </p>
                <p class="text-lg leading-relaxed text-gray-700">
                    从优雅的密封类到简洁的记录类，从模式匹配到文本块，这些"神仙语法"不仅能让你的代码行数减少 30%，还能提高代码可读性和维护性。作为一位使用 JDK 17 已有两年的开发者，我将分享这些强大特性如何在实际项目中为我节省了无数时间，并彻底改变了我编写 Java 代码的方式。
                </p>
            </div>
        </div>
    </section>

    <!-- Feature Overview Visualization -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <h2 class="section-title text-3xl mb-8">JDK 17 核心特性全景图</h2>
            <div class="bg-white rounded-2xl shadow-lg p-8">
                <div class="mermaid">
                    graph TD
                        A[JDK 17 核心特性] --> B[记录类 Record]
                        A --> C[密封类 Sealed Classes]
                        A --> D[模式匹配]
                        A --> E[文本块]
                        A --> F[增强型 Switch]
                        A --> G[其他特性]
                        
                        B --> B1[简化数据类定义]
                        B --> B2[自动生成方法]
                        B --> B3[不可变性保证]
                        
                        C --> C1[控制继承层次]
                        C --> C2[permits 关键字]
                        C --> C3[领域建模优化]
                        
                        D --> D1[instanceof 模式匹配]
                        D --> D2[switch 模式匹配]
                        D --> D3[性能优化]
                        
                        E --> E1[多行字符串]
                        E --> E2[保持格式]
                        E --> E3[无需转义]
                        
                        F --> F1[表达式语法]
                        F --> F2[yield 关键字]
                        F --> F3[箭头语法]
                        
                        G --> G1[改进的 Stream API]
                        G --> G2[增强的 NPE 信息]
                        G --> G3[ZGC 垃圾收集器]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:3px,color:#fff
                        style B fill:#f59e0b,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#10b981,stroke:#fff,stroke-width:2px,color:#fff
                        style D fill:#3b82f6,stroke:#fff,stroke-width:2px,color:#fff
                        style E fill:#ef4444,stroke:#fff,stroke-width:2px,color:#fff
                        style F fill:#8b5cf6,stroke:#fff,stroke-width:2px,color:#fff
                        style G fill:#ec4899,stroke:#fff,stroke-width:2px,color:#fff
                </div>
            </div>
        </div>
    </section>

    <!-- Evolution Timeline -->
    <section class="py-16 px-6">
        <div class="max-w-4xl mx-auto">
            <h2 class="section-title text-3xl">从 JDK 8 到 JDK 17 的进化之路</h2>
            
            <div class="timeline-item">
                <h3 class="text-xl font-bold mb-2 gradient-text">为什么 JDK 17 是里程碑版本</h3>
                <p class="text-gray-700 leading-relaxed">
                    JDK 17 不仅仅是一个普通的版本更新，它标志着 Java 平台的重大转变。作为继 JDK 8 和 JDK 11 之后的又一个长期支持（LTS）版本，JDK 17 集成了自 JDK 9 以来的所有创新特性，是 Java 现代化进程中的重要里程碑。
                </p>
            </div>
            
            <div class="timeline-item">
                <h3 class="text-xl font-bold mb-2 gradient-text">长期支持版本的意义</h3>
                <p class="text-gray-700 leading-relaxed">
                    作为 LTS 版本，JDK 17 将获得至少 8 年的支持期。这意味着企业可以安心地将其应用迁移到 JDK 17 上，享受新特性带来的便利，同时不必担心频繁升级的问题。对于那些仍在使用 JDK 8 的开发者来说，直接跳到 JDK 17 是一个明智的选择。
                </p>
            </div>
        </div>
    </section>

    <!-- Feature Cards -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6">
                <!-- Record Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-yellow-500">
                        <i class="fas fa-database"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">记录类 (Record)</h3>
                    <p class="text-gray-600">一行代码定义数据类，自动生成构造器、getter、equals、hashCode 和 toString</p>
                </div>
                
                <!-- Sealed Classes Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-green-500">
                        <i class="fas fa-lock"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">密封类 (Sealed Classes)</h3>
                    <p class="text-gray-600">精确控制类的继承层次，让领域建模更加安全和清晰</p>
                </div>
                
                <!-- Pattern Matching Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-blue-500">
                        <i class="fas fa-puzzle-piece"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">模式匹配</h3>
                    <p class="text-gray-600">instanceof 和 switch 的革命性升级，让类型检查更加优雅</p>
                </div>
                
                <!-- Text Blocks Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-red-500">
                        <i class="fas fa-align-left"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">文本块</h3>
                    <p class="text-gray-600">轻松处理多行字符串，告别繁琐的字符串拼接</p>
                </div>
                
                <!-- Enhanced Switch Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-purple-500">
                        <i class="fas fa-code-branch"></i>
                    </div>
                    <h3 class="text-xl font-bold mb-2">增强型 Switch</h3>
                    <p class="text-gray-600">switch 表达式化，支持箭头语法和 yield 关键字</p>
                </div>
                
                <!-- Other Features Card -->
                <div class="feature-card rounded-xl p-6">
                    <div class="text-4xl mb-4 text-pink-500">
                        <i class="fas fa-magic"></i>
                    </div>
                    <h3 class="text-xl font-